package org.viettan.android.main.view;

import java.util.List;

import org.viettan.android.main.activities.info.InfoActivity.InfoLink;
import org.viettan.android.main.resources.ResourcesManager;

import android.content.Context;

import com.google.inject.Inject;
import com.google.inject.Provider;

/**
 * Actual factory implementation to create {@link InfoLinkAdapter}s. This is only needed because
 * RoboGuice does not yet support assisted injection.
 */
public class InfoLinkAdapterFactoryImpl implements InfoLinkAdapterFactory {
    private final Provider<ViewUtility> viewUtilityProvider;
    private final Provider<ResourcesManager> resourcesUtilityProvider;

    @Inject
    public InfoLinkAdapterFactoryImpl(Provider<ViewUtility> viewUtilityProvider,
	    Provider<ResourcesManager> resourcesUtilityProvider) {
	this.viewUtilityProvider = viewUtilityProvider;
	this.resourcesUtilityProvider = resourcesUtilityProvider;
    }

    /**
     * Creates a new instance of {@code InfoLinkAdapter}.
     */
    public InfoLinkAdapter create(Context context, int textViewResourceId, List<InfoLink> items) {
	return new InfoLinkAdapter(viewUtilityProvider, resourcesUtilityProvider, context,
		textViewResourceId, items);
    }
}